package com.fangzc.springboot.demo.common.base;

import org.springframework.beans.factory.annotation.Autowired;

/**
 *
 * @author fangzc
 * @version v1
 * @description 请填写文件相关描述
 * @date 2019-5-29
 */
public class BaseService<M extends BaseMapper<T>, T> implements IService<T> {
    @Autowired
    protected M baseMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return baseMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(T record) {
        return baseMapper.insert(record);
    }

    @Override
    public int insertSelective(T record) {
        return baseMapper.insertSelective(record);
    }

    @Override
    public T selectByPrimaryKey(Integer id) {
        return baseMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(T record) {
        return baseMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(T record) {
        return baseMapper.updateByPrimaryKey(record);
    }

    @Override
    public M getBaseMapper() {
        return baseMapper;
    }

}
